package com.lastoffer2.util;

import android.app.Dialog;
import android.app.TimePickerDialog;
import android.app.TimePickerDialog.OnTimeSetListener;
import android.os.Bundle;
import android.support.v4.app.DialogFragment;

public class TimePickerFragment extends DialogFragment {
	 OnTimeSetListener ontimeSet;

	 public TimePickerFragment() {
	 }

	 public void setCallBack(OnTimeSetListener ontime) {
		 ontimeSet = ontime;
	 }

	 private int hours, minutes;

	 @Override
	 public void setArguments(Bundle args) {
		  super.setArguments(args);
		  hours = args.getInt("hours");
		  minutes = args.getInt("minutes");
	 }

	 @Override
	 public Dialog onCreateDialog(Bundle savedInstanceState) {
		 return new TimePickerDialog(getActivity(), ontimeSet, hours, minutes, true);
	 }
}

